package com.hui.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hui.entity.dao.UserBill;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 用户账单表(UserBill)表数据库访问层
 *
 * @author hui
 * @since 2022-07-27 14:46:10
 */
public interface UserBillMapper extends BaseMapper<UserBill> {
    /**
     * 获取累计充值总额
     *
     * @param uid
     * @return
     */
    @Select({"select IFNULL(sum(number),0) from user_bill where status=1 and type='recharge' and pm=1 and category='now_money' and uid=#{uid}"})
    double sumRechargePrice(@Param("uid") Long uid);
}

